// Package router
// @Author: zhangdi
// @File: router_common
// @Version: 1.0.0
// @Date: 2023/10/17 15:16
package router

import (
	"server/application/constant/apis"
	"server/application/controller/sysctrl"
	"server/application/dto"
	"server/pkg/ginp"
)

func init() {
	//通用上传接口
	AppendRouter(ItemInfo{ //search
		Path:           apis.ApiSysCommonUpload,                   //api路径
		Handlers:       ginp.ConvHandler(sysctrl.SysCommonUpload), //对应控制器
		HttpType:       HttpPost,                                  //http请求类型
		NeedLogin:      true,                                      //是否需要登录
		NeedPermission: false,                                     //是否需要鉴权,暂时不用，登录了就可以上传
		PermissionName: "common.upload",                           //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "通用上传接口",
			Description: "上传文件的name 为file",
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiSysCommonGetSiteInfo,                   //api路径
		Handlers:       ginp.ConvHandler(sysctrl.SysCommonGetSiteInfo), //对应控制器
		HttpType:       HttpPost,                                       //http请求类型
		NeedLogin:      false,                                          //是否需要登录
		NeedPermission: false,                                          //是否需要鉴权
		PermissionName: "",                                             //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:      "SysCommonGetSiteInfo",
			RequestDto: dto.ReqSysCommonGetSiteInfo{},
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiSysCommonSaveConfigs,                   //api路径
		Handlers:       ginp.ConvHandler(sysctrl.SysCommonSaveConfigs), //对应控制器
		HttpType:       HttpPost,                                       //http请求类型
		NeedLogin:      true,                                           //是否需要登录
		NeedPermission: false,                                          //是否需要鉴权
		PermissionName: "sys_configs.save",                             //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "SysCommonSaveConfigs",
			RequestDto:  dto.ReqSysCommonSaveConfigs{},
			Description: "",
		},
	})

	AppendRouter(ItemInfo{
		Path:           apis.ApiSysCommonGetConfigs,                   //api路径
		Handlers:       ginp.ConvHandler(sysctrl.SysCommonGetConfigs), //对应控制器
		HttpType:       HttpPost,                                      //http请求类型
		NeedLogin:      false,                                         //是否需要登录
		NeedPermission: false,                                         //是否需要鉴权
		PermissionName: "",                                            //完整的权限名称,会跟权限表匹配
		Swagger: &SwaggerInfo{
			Title:       "SysCommonGetConfigs",
			RequestDto:  dto.ReqSysCommonGetConfigs{},
			Description: "",
		},
	})
	//{{append}}

}
